
clear all
close all
clc

% Load data
load('EWcomparisondata.mat')
load('nw_g1_38 kopi.mat')
new_layer2=load('new_anal.txt');



hold on
% EW layer 1
plot(1:length(l1_prob_1),l1_prob_1,'-s','Color','k','MarkerSize',4)
% EW layer 2
plot(1:length(l2_prob_1),l2_prob_1,'--s','Color','k','MarkerSize',4)
% NW layer 1
plot(1:length(result(1,:)),result(1,:),'-o','Color','k','MarkerSize',4)
% NW layer 2
plot(1:length(new_layer2(:,1)),new_layer2(:,1),'--o','Color','k','MarkerSize',4)

hold off

% Plot annotation
grid('on')
pbaspect([2.5 1 1])
legend_h = legend('location','SouthEast');
xlabel('Total number of received packets [-]')
ylabel('Decoding probability [-]')
set(gca,'XTick',0:10:T_max)
set(gca,'YTick',0:0.1:1)
xlim([T_min T_max])
ylim([0 1])

% fix legend
lh=legend('EW L1, \Gamma_1=0.38','EW L2, \Gamma_1=0.38','NW L1, \Gamma_1=0.38','NW L1 & L2, \Gamma_1=0.38','location','SouthEast')
set(lh,'interpreter','tex')

figname=strcat('nw_ew_comparison.eps');
print(gcf,'-deps',figname)

% Save plot







